//
//  YRJFindNextStationViewCell.m
//  TravelAroundTheWorld
//
//  Created by dllo on 15/10/22.
//  Copyright (c) 2015年 yanrenjie. All rights reserved.
//

#import "YRJFindNextStationViewCell.h"

#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
//#import "YRJTripHeader.h"
@implementation YRJFindNextStationViewCell
- (void)dealloc {
    [_leftImageView release];
    [_upImageView release];
    [_downImageView release];
    [_forAllButton release];
    [_view release];
    
    [super dealloc];
}

// 创建发现下一站的cell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell {
    self.view = [[UIView alloc] init];
    [self.contentView addSubview:self.view];
    [_view release];
    
    self.leftImageView = [[UIImageView alloc] init];
    [self.view addSubview:self.leftImageView];
    [_leftImageView release];
    
    self.upImageView = [[UIImageView alloc] init];
    [self.view addSubview:self.upImageView];
    [_upImageView release];
    
    self.downImageView = [[UIImageView alloc] init];
    [self.view addSubview:self.downImageView];
    [_downImageView release];
    
//    self.forAllButton = [UIButton buttonWithType:UIButtonTypeSystem];
//    [self.view addSubview:self.forAllButton];
//    self.forAllButton.titleLabel.textColor = [UIColor greenColor];
}

- (void)layoutSubviews {
    [super layoutSubviews];
//    self.view.frame = CGRectMake(0, 0, 375, 230);
//    self.leftImageView.frame = CGRectMake(5, 5, 180, 205);
//    self.upImageView.frame = CGRectMake(190, 5, 180, 100);
//    self.downImageView.frame = CGRectMake(190, 110, 180, 100);
//    self.forAllButton.frame = CGRectMake(5, 215, 365, 10);
    
    self.view.frame = CGRectMake(0, 0, WIDTH * (375 / 375.0), HEIGHT);
    self.leftImageView.frame = CGRectMake(WIDTH * (5.0 / 375.0), HEIGHT * (5.0 / 229.5), WIDTH * (180 / 375.0), HEIGHT * (220.0 / 229.5));
    self.upImageView.frame = CGRectMake((190.0 / 375.0) * WIDTH, (5.0 / 229.5) * HEIGHT, (180.0 / 375.0) * WIDTH, (107.5 / 229.5) * HEIGHT);
    self.downImageView.frame = CGRectMake((190.0 / 375.0) * WIDTH, (117.5 / 229.5) * HEIGHT, (180 / 375.0) * WIDTH, (107.5 / 229.5) * HEIGHT);
//    self.forAllButton.frame = CGRectMake((5.0 / 375.0) * WIDTH , (215.0 / 229.5) * HEIGHT, (365.0 / 375.0) * WIDTH, (30.0 / 229.5) * HEIGHT);
//    NSLog(@"%f", HEIGHT);
//    NSLog(@"%f", WIDTH);
    
//    self.view.frame = CGRectMake(0, 0, WIDTH / (WIDTH / 375), HEIGHT);
//    self.leftImageView.frame = CGRectMake(WIDTH / (WIDTH / 5), HEIGHT / (HEIGHT / 5), WIDTH / (WIDTH / 180), HEIGHT / (HEIGHT / 205));
//    self.upImageView.frame = CGRectMake(WIDTH / (WIDTH / 190), HEIGHT / (HEIGHT / 5), WIDTH / (WIDTH / 180), HEIGHT / (HEIGHT / 100));
//    self.downImageView.frame = CGRectMake(WIDTH / (WIDTH / 190), HEIGHT / (HEIGHT / 110), WIDTH / (WIDTH / 180), HEIGHT / (HEIGHT / 100));
//    self.forAllButton.frame = CGRectMake(WIDTH / (WIDTH / 5), HEIGHT / (HEIGHT / 215), WIDTH / (WIDTH / 365), HEIGHT / (HEIGHT / 10));
}
@end
